//++
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Module Name:
//
//  NotificationStorageData.cs
//    
// Abstract:
//
//  Data object for Outlook storage item.
//  
//--

using System;
using System.Diagnostics;
using Microsoft.OfficeCommunicationsServer.Applications.Common;

namespace Microsoft.EnhancedReminders
{
    /// <summary>
    /// Wrapper class for storing Outlook data types.
    /// </summary>
    [Serializable()]
    public class NotificationStorageData
    {
        private NotificationChannelList _masterChannelList;
        private NotificationRules _rules;

        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="channels">The master list of channels.</param>
        /// <param name="rules">Notification rules.</param>
        public NotificationStorageData(NotificationChannelList channels, NotificationRules rules)
        {
            Debug.Assert(channels != null, "channels");
            Debug.Assert(rules != null, "rules");

            _masterChannelList = channels;
            _rules = rules;
        }

        /// <summary>
        /// The master list of channels.
        /// </summary>
        public NotificationChannelList MasterChannelList
        {
            get
            {
                return _masterChannelList;
            }
            set
            {
                Debug.Assert(value != null, "value");
                _masterChannelList = value;
            }
        }

        /// <summary>
        /// The notification rules.
        /// </summary>
        public NotificationRules Rules
        {
            get
            {
                return _rules;
            }
            set
            {
                Debug.Assert(value != null, "value");
                _rules = value;
            }
        }

        /// <summary>
        /// Log the channel and rule data to the verbose trace log.
        /// </summary>
        /// <param name="context">The logging context.</param>
        public void LogTraceInfo(Context context)
        {
            Debug.Assert(context != null, "context");

            if (_masterChannelList != null)
            {
                _masterChannelList.LogTraceInfo(context);
            }

            if (_rules != null)
            {
                _rules.LogTraceInfo(context);
            }
        }
    }
}
